jQuery(document).ready(function () {

    $.backstretch("module/login/img/backgrounds/1.jpg");

    $('.login-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function () {
        $(this).removeClass('input-error');
    });
    $("#login-btn").click(function () {
        var username = $("#form-username").val();
        var password = $("#form-password").val();
        if (username == '') {
            $("#form-username").addClass('input-error');
            return;
        }
        if (password == '') {
            $("#form-password").addClass('input-error');
            return;
        }
        $.post("/auth/login", {username: username, password: password}, function (result) {
            if (result.code == '0') {
                userData = result.data;
            }
        })
    });

});
